from multiprocessing import Process, Lock
from multiprocessing import Queue, Array, Value

def test_queue(index, my_queue):
    my_queue.put(index)

if __name__ == "__main__":
    my_queue = Queue()
    for i in range(10):
        p = Process(target=test_queue, args=(i, my_queue))
        p.start()
    while True:
        print(my_queue.get())